let a = "ssefewf";
console.log("\x1B[31m%s\x1B[0m", a, "开始爬虫");

console.log(`\x1B[31m ${a} 开始爬虫  \x1B[0m`);

console.log(`\x1B[31m =======选号超过100次，未选到合适号码====  \x1B[0m`);

console.log("\x1B[32m =========选出优化后的合适号码======  \x1B[0m");

console.log("\x1B[34m", "-------------爬虫结果-----------");
console.log("res.wzjred");
console.log("-------------------------------- \x1B[0m");

console.log("\x1B[1m  --------------------------------  \x1B[0m");

function efFind(arr, target) {
  let left = 0;
  let right = arr.length;
  while (left < right) {
    let mid = left + Math.floor((right - left) / 2);
    let m = arr[mid];
    if (m == target) {
      right = mid;
    } else if (m > target) {
      right = mid;
    } else if (m < target) {
      left = mid + 1;
    }
  }
  return left;
}

console.log(efFind([0, 1, 3, 6, 10, 14], 5));
console.log(efFind([0, 1, 3, 6, 10, 14], 10));
console.log(efFind([0, 1, 3, 6, 10, 14], 13));
